<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<base href="<%=basePath%>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>抵押贷款</title>
<link rel="stylesheet" href="css/all.css"/>
<script type="text/javascript" src="jquery1.8/jquery-1.8.0.js"></script>
<script type="text/javascript">
//验证姓名   
function yanzheng(){ 
var name = document.getElementById('app_name'); 
// var reg = /^\w{3,}$/;  //用户名格式正则表达式：用户名要至少三位 
var reg = /^[A-Za-z_]$/;
if(name.value.length == 0){ 
//   errname.innerHTML="用户名不能为空"
  $("#y1").html("用户名不能为空").css("color","red");
  errname.className="error"
  return false; 
  } 
 else{ 
  $("#y1").html("✔").css("color","green");
   errname.className="success"; 
   return true; 
   } 
} 

//身份证验证
function yanzheng1(){ 
	  var card = document.getElementById('idcard_num');
	// 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
	  var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
	  if(card.value.length == 0){
		  $("#y2").html("身份证输入不合法").css("color","red");
		  return false; 
	  }
	  if(!reg.test(card.value)){ 
	    $("#y2").html("输入不合规范").css("color","red");
	    errname.className="error"
	    return false; 
	    }
	  else{
		  $("#y2").html("✔").css("color","green");
		  return true; 
	  }
}

//银行卡验证
function yanzheng2() {
	 var bankCard = document.getElementById('bank_num');
	 var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
	 if(bankCard.value.length == 0){
		  $("#y3").html("银行卡输入不合法").css("color","red");
		  return false; 
	  }
	  if(!reg.test(bankCard.value)){ 
	    $("#y3").html("输入不合规范").css("color","red");
	    errname.className="error"
	    return false; 
	    }
	  else{
		  $("#y3").html("✔").css("color","green");
		  return true; 
	  }
}

//金额限制验证
function yanzheng3() {
	 var money= $("#daik_money").val();
	 if(money >=200000 && money <=2000000){
		 $("#y4").html("✔").css("color","green");
		  return true;
	 }else{
		 $("#y4").html("额度超出范围").css("color","red");
		  return false;
	 }
}

//手机验证
function yanzheng4() {
	 var phone = document.getElementById('app_phone');
	 var reg=/^[1][3,4,5,7,8][0-9]{9}$/;
	 if(phone.value.length == 0){
		 $("#y5").html("输入不能位空").css("color","red");
		 return false; 
	  }
	  if(!reg.test(phone.value)){ 
	    $("#y5").html("输入不合规范").css("color","red");
	    errname.className="error"
	    return false; 
	    }
	  else{
		 $("#y5").html("✔").css("color","green");
		 return true; 
	  }
}

//紧急联系人电话验证
function yanzheng5() {
	 var phone1 = document.getElementById('con_phone');
	 var reg=/^[1][3,4,5,7,8][0-9]{9}$/;
	 if(phone1.value.length == 0){
		 $("#y6").html("输入不能位空").css("color","red");
		 return false; 
	  }
	  if(!reg.test(phone1.value)){ 
	    $("#y6").html("输入不合规范").css("color","red");
	    errname.className="error"
	    return false; 
	    }
	  else{
		 $("#y6").html("✔").css("color","green");
		 return true; 
	  }
}

</script>

</head>
<body>
    <!--头部-->
    <div class="header">
        <a href="homePage.jsp" class="logo"  style="top: 9px;" href="##"><img src="images/hyd_logo2.png"/> </a>
        <div class="desc" style="font-size: 35px;">抵押贷款申请</div>
    </div>
    
    <!--版心-->
    <div class="container">
    	<!--好易贷申请带贷款模块-->
    	<div class="register">
    		<div>
    			<form action="<%=basePath%>ApplyAction/addApplyInfo.do" method="post" enctype="multipart/form-data" >
    			<h3>抵押资料填写:</h3><br />
    			<input type="hidden"  name="pay_num" value="${pay_num}">
    			<input type="hidden" name="op" value="diya" />
    			<input type="hidden" name="pro_id" value="20" />
    			
	    		<!--姓名-->
	    		<div class="register-box">
	    			<!--表单项-->
	    			<div class="box default">
	    				<label>姓&nbsp;&nbsp;名:</label>
	    				<input type="text" placeholder="请输入您的姓名" name="app_name" value="" id="app_name" onblur="yanzheng()"/>
	    				<span id="y1">请输入至少3位的用户名</span>
	    				<i></i>
	    			</div>
	    			<!--提示信息-->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		
	    		<!--身份证号-->
	    		<div class="register-box">
	    			<!--表单项-->
	    			<div class="box default">
	    				<label>身份证号码:</label>
	    				<input type="text" placeholder="请输入您的身份证号" name="idcard_num" id="idcard_num" value="" onblur="yanzheng1()"/>
	    				<span id="y2">输入15/18位数证件号</span>
	    				<i></i>
	    			</div>
	    			<!--提示信息-->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		
	    		<!--银行卡号-->
	    		<div class="register-box">
	    			<!--表单项-->
	    			<div class="box default">
	    				<label>银行卡卡号:</label>
	    				<input type="text" placeholder="请输入您的银行卡号" name="bank_num" id="bank_num" value="" onblur="yanzheng2()"/>
	    				<span id="y3">18位的银行卡号</span>
	    				<i></i>
	    			</div>
	    			<!--提示信息-->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		
	    		<!--贷款金额-->
	    		<div class="register-box">
	    			<!-- 表单项 -->
	    			<div class="box default">
	    				<label>贷 款 金 额:</label>
	    				<input type="text" placeholder="请输入贷款金额" name="daik_money" id="daik_money" value="" onblur="yanzheng3()"/>
	    				<span id="y4">额度20万-200万</span>
	    				<i></i>
	    			</div>
	    			<!--提示信息-->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		<!--贷款用途 -->
	    		<div class="register-box">
					<!--表单项 -->
	    			<div class="box default">
	    				<label>贷 款 用 途:</label>
	    				<input type="text" placeholder="请输入贷款用途" name="daik_use" value=""/>
	    				<i></i>
	    			</div>
	    			<!-- 提示信息 -->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		
	    		<!--手 机 号 码-->
	    		<div class="register-box">
	    			<!--表单项-->
	    			<div class="box default">
	    				<label for="mobile">手 机 号 码:</label>
	    				<input type="text" placeholder="请输入手机号" id="app_phone" name="app_phone" value="" onblur="yanzheng4()"/>
	    				<span id="y5">请输入11位手机号</span>
	    				<i></i>
	    			</div>
	    			<!--提示信息-->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
    			
    			<!-- 家庭住址 -->
	    		<div class="register-box">
					<!--表单项 -->
	    			<div class="box default">
	    				<label>家 庭 住 址:</label>
	    				<input type="text" placeholder="请输入家庭地址" name="app_address" value=""/>
	    				<i></i>
	    			</div>
	    			<!-- 提示信息 -->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
    			
    	
	    		<!--紧急联系人-->
	    		<div class="register-box">
	    			<!--表单项-->
	    			<div class="box default">
	    				<label for="linkman">紧急联系人:</label>
	    				<input type="text" id="linkman" placeholder="请输入姓名" name="con_name" value=""/>
	    				<i></i>
	    			</div>
	    			<!--提示信息-->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		<!-- 紧急联系人电话 -->
	    		<div class="register-box">
	    			<!--表单项-->
	    			<div class="box default">
	    				<label for="linkman1">紧急联系人电话: </label>
	    				<input type="text" placeholder="请输入联系人电话" name="con_phone" id="con_phone" value="" onblur="yanzheng5()"/>
	    				<span id="y6">请输入11位手机号</span>
	    				<i></i>
	    			</div>
	    			<!--提示信息-->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		
	    		<!-- 公司名称 -->
	    		<div class="register-box">
					<!--表单项 -->
	    			<div class="box default">
	    				<label>公司名称:</label>
	    				<input type="text" placeholder="请输入公司名称" name="company_name" value=""/>
	    				<i></i>
	    			</div>
	    			<!-- 提示信息 -->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		
	    		<!-- 公司地址 -->
	    		<div class="register-box">
					<!--表单项 -->
	    			<div class="box default">
	    				<label>公司地址:</label>
	    				<input type="text" placeholder="请输入公司地址" name="company_add" value=""/>
	    				<i></i>
	    			</div>
	    			<!-- 提示信息 -->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		
	    		<!--
                	作者：offline
                	时间：2018-04-05
                	描述：下拉框
                -->
				
                <link type="text/css" rel="stylesheet" href="css/style.css" />
                <!--婚姻状况-->
					婚姻状况: <input type="radio" id="idCard" name="mar_state" value="未婚"/>未婚
    				<input type="radio" id="idCard" name="mar_state" value="已婚"/>已婚<br/>
               <label>贷款类型:</label>
               <select  name="tid" id="queryFenqi">
               		<option value="">--请选择--</option>
               		<option value="10">等额本息</option>
               		<option value="20">先息后本</option>
               </select>&nbsp;&nbsp;
<!--                <p/> -->
				<label>贷款分期:</label>
				<select name="fq_id" id="fenshu">
 					<option value="">--选择分期--</option> 
				</select><p/> 
<!-- 				<br> -->
<!-- 	    		是否需要提前还款: <input type="radio" name="tq" />是	<input type="radio" name="tq"  />否<p/> -->
		    	<!--身份证正面上传-->
		    	<p>  
            		身份证正面：<input type="file" name="pics" />  
		        </p> 
		        <p>  
            		身份证反面：<input type="file" name="pics" />  
		        </p> 
		        <p>  
            		银行卡正面：<input type="file" name="pics" />  
		        </p> 
		        <p>  
            		银行卡反面：<input type="file" name="pics" />  
		        </p> 
		        <p>  
            		抵押证明：<input type="file" name="pics" />  
		        </p>
		    	
<!-- 			    <div class="control-group"> -->
<!-- 		      		<label class="control-label leipiplugins-orgname">身份证正面上传</label> -->
<!-- 			      	<div> -->
<!-- 			        	<input type="file" name="imgs" title="文件上传" class="leipiplugins" leipiplugins="uploadfile"> -->
<!-- 			      	</div> -->
<!-- 		    	</div> -->
		    	<!-- 身份证反面上传 -->
<!-- 		    	<div class="control-group"> -->
<!-- 		      		<label class="control-label leipiplugins-orgname">身份证反面上传</label> -->
<!-- 			      	<div> -->
<!-- 			        	<input type="file" name="imgs" title="文件上传" class="leipiplugins" leipiplugins="uploadfile"> -->
<!-- 			      	</div> -->
<!-- 		    	</div> -->
	    			
	    		
		    	<!--银行卡正面上传-->
<!-- 			    <div class="control-group"> -->
<!-- 		      		<label class="control-label leipiplugins-orgname">银行卡正面上传</label> -->
<!-- 			      	<div> -->
<!-- 			        	<input type="file" name="imgs" title="文件上传" class="leipiplugins" leipiplugins="uploadfile"> -->
<!-- 			      	</div> -->
<!-- 		    	</div> -->
		    	<!--银行卡反面上传-->
<!-- 			    <div class="control-group"> -->
<!-- 		      		<label class="control-label leipiplugins-orgname">银行卡反面上传</label> -->
<!-- 			      	<div> -->
<!-- 			        	<input type="file" name="imgs" title="文件上传" class="leipiplugins" leipiplugins="uploadfile"> -->
<!-- 			      	</div> -->
<!-- 		    	</div> -->
		    	
	    		
		    	<!--银行流水上传-->
<!-- 			    <div class="control-group"> -->
<!-- 		      		<label class="control-label leipiplugins-orgname">银行流水上传</label> -->
<!-- 			      	<div> -->
<!-- 			        	<input type="file" name="pics" title="文件上传" class="leipiplugins" leipiplugins="uploadfile"> -->
<!-- 			      	</div> -->
<!-- 		    	</div> -->
		    	
		    	<!--个体户营业执照-->
<!-- 			    <div class="control-group"> -->
<!-- 		      		<label class="control-label leipiplugins-orgname">个体户营业执照上传</label> -->
<!-- 			      	<div> -->
<!-- 			        	<input type="file" name="perimg" title="文件上传" class="leipiplugins" leipiplugins="uploadfile"> -->
<!-- 			      	</div> -->
<!-- 		    	</div> -->
		    	
		    	
	    		
	    		<!--注册协议-->
	    		<div class="register-box xieyi">
	    			<!--表单项-->
	    			<div class="box default">
	    				<input type="checkbox" id="ck" />
	    				<span>我已阅读并同意<a href="##">《好易贷借款信息咨询与服务协议》</a></span>
	    			</div>
	    			<!--提示信息-->
	    			<div class="tip">
	    				<i></i>
	    				<span></span>
	    			</div>
	    		</div>
	    		
	    		<!--提交-->
<!-- 	    		<button id="btn">提交</button> -->
					<h2><input type="submit" value="提交"></h2>
	    		</form>
    		</div>
    	</div>
    </div>
    
    <!-- 公司简介说明 -->
    	<div class="foot" style="margin-top: 60px; margin-left: 0px;">
  			<div class="foot1">
    			<center>cCopyright ©2009-2015 Edai Corporation.All Rights Reserved.<br/>深圳市好易贷金融信息服务有限公司  粤ICP备13010370-1号-1  粤B -20120049</center>
  			</div>
 		</div>
</body>

<style type="text/css">
	/*foot*/
	.foot { width:200%; height:auto; min-height:70px; background:#333; margin-top:30px; }
	.foot1{ width:1204px; color:#FFF; }
	.foot1 p { line-height:30px; height:30px; }
</style>

<script type="text/javascript" src="jquery1.8/jquery.js"></script>
<script type="text/javascript">
	
	//贷款类型
	function gaibian() {
		var xin = $("#xingyong").val();
		if(xin=='10'){
			$("#xiao").css("display","block");
		}else{
			$("#xiao").css("display","none");
		}
	}
	
	//ajax级联查询
		$("#queryFenqi").change(function(){
			$.ajax({
				url:"queryFenqi.do",
				data:{"tid":$("#queryFenqi").val()},
				type:"post",
				dataType:"json",
				success:function(data){
					for ( var i in data) {
						var jsonObj=data[i];
						var optionstring="";
						for (var j = 0; j < jsonObj.length; j++) {
							optionstring+="<option value=\"" +jsonObj[j].fid + "\">" +jsonObj[j].fname +"</option>";
							$("#fenshu").html("<option value=''>请选择</option>" +optionstring);
						}
					}
				},
				error:function(){
					alert("出现异常");
				}
			});
		});
	


</script>
<style type="text/css">
*{margin:0;padding:0;}
select{outline:none;}
ul{list-style:none;}
a{text-decoration:none;}
</style>

</html>